﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chimmy.Model
{
    public static class Extensions
    {
        public static TValue GetByKey<TKey, TValue>(this List<KeyValuePair<TKey, TValue>> mapping, TKey key)
        {
            foreach (var kvp in mapping)
                if (kvp.Key.Equals(key))
                {
                    return kvp.Value;
                }

            return default(TValue);
        }
    }
}
